H<%@page import="org.apache.struts2.components.Else"%>
<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>   
    <title>Create New VM</title>
    <%
    	if(session.getAttribute("username")==null||session.getAttribute("username").toString().equals(""))
    	{
    		response.sendRedirect(request.getContextPath()+"/login.html");
    		return;
    	}
    	else if(request.getParameter("model")==null||request.getParameter("model")=="")
    	{
    		response.sendRedirect(request.getContextPath()+"/QBX_VM_Edit/CreateVM.html");
    	}
    	else
    	{
    		session.setAttribute("model",(String)request.getParameter("model")); 
    		session.setAttribute("qbx_number",(String)request.getParameter("qbx_number")); 
    		session.setAttribute("alona_number",(String)request.getParameter("alona_number")); 
    		session.setAttribute("aisles_number",(String)request.getParameter("aisles_number")); 
    		session.setAttribute("venue_code",(String)request.getParameter("venue_code")); 
    		session.setAttribute("venue_type",(String)request.getParameter("venue_type")); 
    		session.setAttribute("unit",(String)request.getParameter("unit")); 
    		session.setAttribute("city",(String)request.getParameter("city")); 
    		session.setAttribute("region",(String)request.getParameter("region"));
    	} 
    %>
	    
    <jsp:useBean id="dbHandle" scope="application" class="DBHandle.General" />
    <script src="../../JavaScript/jquery-1.6.4.js"></script>
	<script type='text/javascript' src='../../JavaScript/AutoComplete/jquery.bgiframe.min.js'></script> 
	<script type='text/javascript' src='../../JavaScript/AutoComplete/jquery.ajaxQueue.js'></script> 
	<script type='text/javascript' src='../../JavaScript/AutoComplete/thickbox-compressed.js'></script> 
	<script type='text/javascript' src='../../JavaScript/AutoComplete/jquery.autocomplete.js'></script>
    <script type='text/javascript' src='../../JavaScript/AutoComplete/localdata.js'></script>
    <script src="../../JavaScript/jquery.alphanumeric.js"></script>
    <script src="../../JavaScript/jquery.poshytip.js"></script>
    <script src="../../JavaScript/CreateAisles.js"></script>
    <link rel="stylesheet" href="../../JavaScript/tip-yellowsimple/tip-yellowsimple.css" type="text/css" />
	<link rel="stylesheet" type="text/css" href="../../JavaScript/AutoComplete/css/jquery.autocomplete.css" /> 
	<link rel="stylesheet" type="text/css" href="../../JavaScript/AutoComplete/css/thickbox.css" /> 

  </head>
  
  <body>
  	<div><span> VM
  	<img alt="==>" src="../../Image/arrowLeft.gif" border="0">&nbsp;
  	<a onclick="history.go(-1)">VM Profile</a>
  	<img alt="==>" src="../../Image/arrowLeft.gif" border="0">&nbsp;
  	<a >VM Profile</a>
  	</span>
  	</div>
  	<div class="tab">
    	<br>
   		<hr>
    	<br>
  	</div>
  	<div>
  		<table>
  			<tr>
  				<td>Model:<%=(String)request.getParameter("model")%></td>
  				<td>QBX Number:<%=(String)request.getParameter("qbx_number")%></td>
  				<td>Alona Number:<%=(String)request.getParameter("alona_number")%></td>
  				<td>Number of Aisles:<%=(String)request.getParameter("aisles_number")%></td>
  			</tr>
  			<tr>
  				<td>Venue Code:<%=(String)request.getParameter("venue_code")%></td>
  				<td>Venue Type:<%=(String)request.getParameter("venue_type")%></td>
  				<td>Number of Unit:<%=(String)request.getParameter("unit")%></td>
  				<td>City:<%=(String)request.getParameter("city")%></td>
  				<td>Region:<%=(String)request.getParameter("region")%></td>
  			</tr>
  		</table>
  	</div>
  	<div>
  		Please enter items and prices
  	</div>
  	<div>
  	<form>
  		<table id="table"> 
  			<%
  			for(int i=0;i<7;i++)
  			{
  				out.print("<tr><th></th>");
  				for(int j=1;j<9;j++)
  				{
  					out.print("<th>A"+String.valueOf(i*8+j)+"</th>");
  				}
  				out.print("</tr>");
  				out.print("<tr id='item'><th scope=\"row\">Item</th>");
  				for(int k=1;k<9;k++)
  				{
  					out.print("<td><input type='text' class ='item' id='I"+String.valueOf(i*8+k)+"' name='I"+String.valueOf(i*8+k)+"'/></td>");
  				}
  				out.print("</tr>");
  				out.print("<tr id='price'><th scope=\"row\">Price($)</th>");
  				for(int k=1;k<9;k++)
  				{
  					out.print("<td><input type='text' class='price' id='P"+String.valueOf(i*8+k)+"' name='P"+String.valueOf(i*8+k)+"'/></td>");
  				}
  				out.print("</tr>");
  			}
  		 	%>
		</table>
		<button type="button" id="back">Back</button>
		<button type="reset" id="reset">Reset</button>
		<button type="button" id="save">Save&Continue</button>
	</form>
 	</div>
  </body>
</html>